package com.rparoxysm.util;

import java.util.Map;
import java.util.HashMap;
import java.util.Set;

public class DebugControl {
    private static DebugControl debugControl = new DebugControl();
    private Map<String, Debug> handles = new HashMap<String, Debug>();

    private static Debug debug = Debug.init("Debug");

    private DebugControl() {
    }

    public static DebugControl getControl() {
	return debugControl;
    }

    public synchronized void register(Debug debugHandle) {
	if(debugHandle != null) {
	    handles.put(debugHandle.getScope(), debugHandle);
	}
    }

    public synchronized Debug getHandle(String scope) {
	Debug handle = null;
	if(scope != null) {
	    handle = handles.get(scope);
	}
	return handle;
    }

    public synchronized Set getScopeSet() {
	return handles.keySet();
    }
}
